Skip to content

fix: tailwindcss config#7693

Merged
jinmao88 merged 7 commits intovbenjs:mainfrom
xingyu4j:fix-tailwindcss
Mar 19, 2026
Merged

fix: tailwindcss config#7693
jinmao88 merged 7 commits intovbenjs:mainfrom
xingyu4j:fix-tailwindcss

Conversation

@xingyu4j
Copy link
Copy Markdown
Contributor

@xingyu4j xingyu4j commented Mar 18, 2026

Description

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Checklist

ℹ️ Check all checkboxes - this will indicate that you have done everything in accordance with the rules in CONTRIBUTING.

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs:dev command.
  • Run the tests with pnpm test.
  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • Chores

    • Introduced a dedicated internal Tailwind theme package and added it to the workspace; updated dev dependencies and Node engine ranges.
    • Adjusted dependency catalog versions and updated tooling ignore lists and workspace config.
  • Refactor

    • Consolidated theme usage so components and styles reference the centralized Tailwind theme.
  • Documentation

    • Updated project Tailwind integration and scanning guidance.
  • Bug Fixes

    • Changed log level for an upload drag-sort event in the playground.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 18, 2026

⚠️ No Changeset found

Latest commit: 1caa969

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6a3af5ff-9e94-4627-9594-67ed03010ddf

📥 Commits

Reviewing files that changed from the base of the PR and between beef38e and 1caa969.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • pnpm-workspace.yaml
✅ Files skipped from review due to trivial changes (1)
  • pnpm-workspace.yaml

📝 Walkthrough

Walkthrough

Centralizes Tailwind theme into a new internal package @vben/tailwind-config, moves extensive theme/CSS out of packages/@core/base/design/src/css/global.css into internal/tailwind-config/src/theme.css, and updates docs, components, tooling, workspace, and dependency references accordingly.

Changes

Cohort / File(s) Summary
Core Theme Package
internal/tailwind-config/package.json, internal/tailwind-config/src/index.ts, internal/tailwind-config/src/theme.css
Add new @vben/tailwind-config package; import ./theme.css and introduce consolidated Tailwind theme, colors, keyframes, utilities, base styles (+~569 lines).
Design Styles Replacement
packages/@core/base/design/src/css/global.css
Replaced previous inline theme with a single import: @import '@vben/tailwind-config/theme';.
Component & Asset Theme References
packages/@core/.../*.vue, packages/@core/.../style.css, packages/@core/ui-kit/shadcn-ui/src/assets/index.css, packages/@core/base/design/src/css/nprogress.css
Updated style imports from legacy/local theme paths to @vben/tailwind-config/theme; added new shadcn-ui asset referencing the theme.
Docs & Guides
docs/package.json, docs/src/**/tailwindcss.md
Docs updated to reference @vben/tailwind-config and the new theme entry path; docs package.json added devDependency on the workspace package.
Tooling & Plugins
.vscode/settings.json, internal/vite-config/src/plugins/tailwind-reference.ts, internal/lint-configs/oxlint-config/src/configs/tailwindcss.ts
VSCode, Vite plugin, and lint config updated to point to new theme path / entryPoint.
Workspace, Dependencies & Scripts
package.json, packages/@core/base/design/package.json, pnpm-workspace.yaml, scripts/vsh/src/check-dep/index.ts, vben-admin.code-workspace
Added workspace dependency @vben/tailwind-config, removed some transitive design deps, bumped node engine range slightly, updated catalog package versions, added package to depignore, and registered workspace folder.
Small Behavioral Change
playground/src/views/examples/form/basic.vue
Changed a log call from console.info to console.warn in an image drag-sort handler.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

bug, dependencies, documentation

Suggested reviewers

  • anncwb
  • vince292007
  • mynetfan
  • jinmao88

Poem

🐰 I hopped through CSS and code,
Piled colors, keys, and mode,
One theme burrow, tidy and warm,
Now imports snugly keep the form,
Hooray — the styles take storm! 🎋

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is empty of actual content—only the repository template remains with all checkboxes unchecked and no implementation details, context, or change summary provided. Fill in the description with details about what the Tailwind CSS config fix addresses, why the changes were made, any breaking changes, and which checklist items apply.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: restructuring and centralizing Tailwind CSS configuration from multiple locations into a new dedicated package.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs/src/en/guide/project/tailwindcss.md (1)

12-18: ⚠️ Potential issue | 🟡 Minor

Documentation references outdated location for Tailwind directives.

Similar to the Chinese documentation, line 12 states directives are in global.css, but global.css now only contains an import. The actual directives are in theme.css.

-In `global.css`, you will see the Tailwind CSS v4 directives currently used by the project, such as:
+In `theme.css`, you will see the Tailwind CSS v4 directives currently used by the project, such as:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/en/guide/project/tailwindcss.md` around lines 12 - 18, Update the
documentation text in tailwindcss.md to point readers to theme.css instead of
global.css: replace the sentence that says directives are in `global.css` with
one that explains `global.css` only contains an import and the actual Tailwind
CSS v4 directives (`@source`, `@custom-variant`, `@theme`, `@theme inline`,
`@utility`) live in `theme.css`, and adjust any nearby references or examples
that assume `global.css` contains those directives.
docs/src/guide/project/tailwindcss.md (1)

12-18: ⚠️ Potential issue | 🟡 Minor

Documentation references outdated location for Tailwind directives.

Line 12 states directives are in global.css, but after this PR, global.css only contains @import '@vben/tailwind-config/theme'. The actual directives (@source, @custom-variant, @theme, @utility) now reside in internal/tailwind-config/src/theme.css.

Consider updating this section to reference theme.css instead:

-在 `global.css` 中你会看到当前项目使用的 Tailwind CSS v4 指令,例如:
+在 `theme.css` 中你会看到当前项目使用的 Tailwind CSS v4 指令,例如:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/guide/project/tailwindcss.md` around lines 12 - 18, Update the
documentation to point readers to the new location of the Tailwind directives:
replace the reference to `global.css` with
`internal/tailwind-config/src/theme.css` and note that `global.css` now only
contains `@import '@vben/tailwind-config/theme'`; explicitly list the directives
(`@source`, `@custom-variant`, `@theme`, `@theme inline`, `@utility`) as
residing in `theme.css` so readers are directed to the correct file (look for
mentions of `global.css` and the directive list in this guide and change them to
reference `internal/tailwind-config/src/theme.css` and the import behavior).
🧹 Nitpick comments (1)
packages/@core/base/design/src/css/nprogress.css (1)

43-61: Duplicate @keyframes definition.

The @keyframes nprogress-spinner is defined twice (lines 43-51 and 53-61). This appears to be pre-existing but could be cleaned up.

♻️ Remove duplicate keyframes
 `@keyframes` nprogress-spinner {
   0% {
     transform: rotate(0deg);
   }

   100% {
     transform: rotate(360deg);
   }
 }
-
-@keyframes nprogress-spinner {
-  0% {
-    transform: rotate(0deg);
-  }
-
-  100% {
-    transform: rotate(360deg);
-  }
-}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/`@core/base/design/src/css/nprogress.css around lines 43 - 61,
Remove the duplicate `@keyframes` nprogress-spinner definition: keep a single
nprogress-spinner keyframes block and delete the repeated one so there aren’t
two identical `@keyframes` rules; ensure the remaining `@keyframes`
nprogress-spinner preserves the rotate(0deg) to rotate(360deg) animation and
that any CSS referring to nprogress-spinner continues to work.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@docs/src/en/guide/project/tailwindcss.md`:
- Around line 12-18: Update the documentation text in tailwindcss.md to point
readers to theme.css instead of global.css: replace the sentence that says
directives are in `global.css` with one that explains `global.css` only contains
an import and the actual Tailwind CSS v4 directives (`@source`,
`@custom-variant`, `@theme`, `@theme inline`, `@utility`) live in `theme.css`,
and adjust any nearby references or examples that assume `global.css` contains
those directives.

In `@docs/src/guide/project/tailwindcss.md`:
- Around line 12-18: Update the documentation to point readers to the new
location of the Tailwind directives: replace the reference to `global.css` with
`internal/tailwind-config/src/theme.css` and note that `global.css` now only
contains `@import '@vben/tailwind-config/theme'`; explicitly list the directives
(`@source`, `@custom-variant`, `@theme`, `@theme inline`, `@utility`) as
residing in `theme.css` so readers are directed to the correct file (look for
mentions of `global.css` and the directive list in this guide and change them to
reference `internal/tailwind-config/src/theme.css` and the import behavior).

---

Nitpick comments:
In `@packages/`@core/base/design/src/css/nprogress.css:
- Around line 43-61: Remove the duplicate `@keyframes` nprogress-spinner
definition: keep a single nprogress-spinner keyframes block and delete the
repeated one so there aren’t two identical `@keyframes` rules; ensure the
remaining `@keyframes` nprogress-spinner preserves the rotate(0deg) to
rotate(360deg) animation and that any CSS referring to nprogress-spinner
continues to work.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b15cc79b-4c11-4657-9364-a40befe711c4

📥 Commits

Reviewing files that changed from the base of the PR and between 885a0a9 and e87143f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (23)
  • .vscode/settings.json
  • docs/package.json
  • docs/src/en/guide/project/tailwindcss.md
  • docs/src/guide/project/tailwindcss.md
  • internal/lint-configs/oxlint-config/src/configs/tailwindcss.ts
  • internal/tailwind-config/package.json
  • internal/tailwind-config/src/index.ts
  • internal/tailwind-config/src/theme.css
  • internal/vite-config/src/plugins/tailwind-reference.ts
  • package.json
  • packages/@core/base/design/package.json
  • packages/@core/base/design/src/css/global.css
  • packages/@core/base/design/src/css/nprogress.css
  • packages/@core/ui-kit/menu-ui/src/components/normal-menu/normal-menu.vue
  • packages/@core/ui-kit/shadcn-ui/src/assets/index.css
  • packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/breadcrumb-background.vue
  • packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue
  • packages/effects/common-ui/src/components/cropper/cropper.vue
  • packages/effects/layouts/src/widgets/theme-toggle/theme-button.vue
  • packages/effects/plugins/src/vxe-table/style.css
  • pnpm-workspace.yaml
  • scripts/vsh/src/check-dep/index.ts
  • vben-admin.code-workspace

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
playground/src/views/examples/form/basic.vue (1)

368-370: Questionable log level change: console.infoconsole.warn.

This change appears unrelated to the PR's objective (tailwindcss config fix). Additionally, console.warn is semantically intended for potential problems or cautionary messages, whereas logging a normal drag-sort operation is purely informational. Consider reverting to console.info, or removing this debug logging entirely if it was added temporarily.

🔧 Suggested revert
        onDragSort: (oldIndex: number, newIndex: number) => {
-          console.warn(`图片从 ${oldIndex} 移动到 ${newIndex}`);
+          console.info(`图片从 ${oldIndex} 移动到 ${newIndex}`);
        },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@playground/src/views/examples/form/basic.vue` around lines 368 - 370, The
onDragSort handler currently uses console.warn for a normal informational event
(function onDragSort: (oldIndex: number, newIndex: number) => { ... }), which is
semantically incorrect and unrelated to the PR; change the console.warn back to
console.info (or remove the debug statement entirely) so that the drag-sort
message is logged at an informational level or not logged in production. Ensure
you update the onDragSort callback accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@playground/src/views/examples/form/basic.vue`:
- Around line 368-370: The onDragSort handler currently uses console.warn for a
normal informational event (function onDragSort: (oldIndex: number, newIndex:
number) => { ... }), which is semantically incorrect and unrelated to the PR;
change the console.warn back to console.info (or remove the debug statement
entirely) so that the drag-sort message is logged at an informational level or
not logged in production. Ensure you update the onDragSort callback accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2b4889a8-a033-4162-82b0-a2a7cc30d8ab

📥 Commits

Reviewing files that changed from the base of the PR and between e87143f and beef38e.

📒 Files selected for processing (2)
  • internal/lint-configs/eslint-config/src/configs/node.ts
  • playground/src/views/examples/form/basic.vue

@jinmao88 jinmao88 merged commit 0c300d0 into vbenjs:main Mar 19, 2026
14 checks passed
@xingyu4j xingyu4j mentioned this pull request Mar 19, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants